/*
 *      Copyright 2008 Battams, Derek
 *       
 *       Licensed under the Apache License, Version 2.0 (the "License");
 *       you may not use this file except in compliance with the License.
 *       You may obtain a copy of the License at
 *
 *          http://www.apache.org/licenses/LICENSE-2.0
 *
 *       Unless required by applicable law or agreed to in writing, software
 *       distributed under the License is distributed on an "AS IS" BASIS,
 *       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *       See the License for the specific language governing permissions and
 *       limitations under the License.
 */
package com.google.code.gwtsrwc.client;

import com.google.gwt.user.client.ui.Widget;

/**
 * An interface that describes the required functionality of all data stored in a TableModel
 * @author $Author: derek@battams.ca $
 * @version $Id: TableData.java 11 2008-09-04 00:43:06Z derek@battams.ca $
 * $URL: http://gwtsrwc.googlecode.com/svn/trunk/src/com/google/code/gwtsrwc/client/TableData.java $
 */
public interface TableData {
	/**
	 * Return the Widget stored in the specified column
	 * @param column The column id to return data for
	 * @return The Widget stored in the specified column or null if the specified column does not exist
	 */
	public Widget get(String column);
	
	/**
	 * Set the Widget for the specified column
	 * @param column The column to be set
	 * @param w The Widget to be stored for the given column
	 */
	public void set(String column, Widget w);
	
	/**
	 * Compare column data for this column against that of the specified TableData obj
	 * @param obj The TableData object this object is being compared against
	 * @param column The column id of each object that should be compared
	 * @return True if this object should come before obj in an _ascending_ sort of the two objects or false otherwise 
	 */
	public boolean compare(TableData obj, String column);
}